The Port Reference
Several Open Transport port information functions take as a parameter a pointer to a port reference, which is a 32-bit valueOTPortRef
) that contains a port's device and bus type, its slot number, and information to distinguish among several devices on a single slot. The contents of the port reference are private. To create a port reference and obtain a pointer to it, you call theOTCreatePortRef
function (page 6-35).The port reference is defined by the
OTPortRef
data type.
typedef UInt32 OTPortRef;You can use theOTCreatePortRef
function (page 6-35) to create a port reference, and the port reference is also a field in the port structure returned by the port information functions:OTGetIndexedPort
(page 6-32),OTFindPort
(page 6-33), andOTFindPortByRef
(page 6-34). To extract information from the port reference, you need to use the functionsOTGetDeviceTypeFromPortRef
(page 6-38),OTGetBusTypeFromPortRef
(page 6-39), andOTGetSlotFromPortRef
(page 6-40).This section lists the possible values for the device type and bus type.
Possible hardware device types are given in the following enumeration:
- Note
- Do not arbitrarily add new device types. Please contact Developer Support at Apple Computer, Inc. to obtain a new, unique device type.
![]()
enum { kOTNoDeviceType = 0, kOTADEVDevice = 1, kOTMDEVDevice = 2, kOTLocalTalkDevice = 3, kOTIRTalkDevice = 4, kOTTokenRingDevice = 5, kOTISDNDevice = 6, kOTATMDevice = 7, kOTSMDSDevice = 8, kOTSerialDevice = 9, kOTEthernetDevice = 10, kOTSLIPDevice = 11, kOTPPPDevice = 12, kOTModemDevice = 13, kOTFastEthernetDevice = 14, kOTFDDIDevice = 15, kOTATMLANDevice = 16, kOTATMSNAPDevice = 17, kOTPseudoDevice = 1023, kOTLastDeviceIndex = 1022, kOTLastSlotNumber = 255, kOTLastOtherNumber = 255 };Constant descriptions
Possible bus types are given in the following enumeration:
kOTNoDeviceType
- The port's device type is not specified. This value is illegal.
kOTADEVDevice
- The port is specified as an ADEV device, which is a pseudodevice used by AppleTalk.
kOTMDEVDevice
- The port is specified as an MDEV device, which is a pseudodevice used by TCP.
kOTLocalTalkDevice
- The port is specified as a LocalTalk device.
kOTIRTalkDevice
- The port is specified as an IRTalk device.
kOTTokenRingDevice
- The port is specified as a token ring device.
kOTISDNDevice
- The port is specified as an ISDN device.
kOTATMDevice
- The port is specified as an ATM device.
kOTSMDSDevice
- The port is specified as a SMDS device.
kOTSerialDevice
- The port is specified as a serial device.
kOTEthernetDevice
- The port is specified as an Ethernet device.
kOTSLIPDevice
- The port is specified as a SLIP pseudodevice.
kOTPPPDevice
- The port is specified as a PPP pseudodevice.
kOTModemDevice
- The port is specified as a modem pseudodevice.
kOTFastEthernetDevice
- The port is specified as an 100 MB Ethernet device.
kOTFDDIDevice
- The port is specified as a FDDI device.
kOTATMLANDevice
- The port is specified as an ATM pseudodevice simulating a LAN device, using ATMLAN emulation.
kOTATMSNAPDevice
- The port is specified as an ATM pseudodevice simulating a SNAP device.
kOTPseudoDevice
- The port is designated as a pseudodevice.
kOTLastDeviceIndex
- The maximum number of different device types that a port can support.
kOTLastSlotNumber
- The highest physical slot number a port can use.
kOTLastOtherNumber
- The maximum number of ports a single slot can support.
enum{ kOTUnknownBusPort = 0, kOTMotherboardBus = 1, kOTNuBus = 2, kOTPCIBus = 3, kOTGeoPort = 4, kOTPCMCIABus = 5, kOTLastBusIndex = 15 };Constant descriptions
kOTUnknownBusPort
- The port's bus type is not a known type.
kOTMotherboardBus
- The port is on the motherboard bus.
kOTNuBus
- The port is on a NuBus bus.
kOTPCIBus
- The port is on a PCI bus.
kOTGeoPort
- The port is a GeoPort device.
kOTPCMCIABus
- The port is on a PCMCIA bus.
kOTLastBusIndex
- The maximum number of different bus types that the port can support.